/**
 * 
 */
package data;

import data.Constants;

/**
 * @author mirre
 * <b> under construction </b>
 */
public class GameField 
{
	private int width;
	private int height;
	private FieldState[][] fields;
	
	public GameField()
	{
		width = Constants.GAMEFIELD_SIZE;
		height = Constants.GAMEFIELD_SIZE;
		initFields();
	}
	
	private void initFields() 
	{
		fields = new FieldState[width][height];
		for(int x = 0; x < width; x++)
			for(int y = 0; y < height; y++)
				fields[x][y] = FieldState.Water;
	}
	
	public void SetState(int x, int y, FieldState state)
	{
		fields[y][x] = state;
	}
	
	public int GetWidth()
	{
		return width;
	}
	
	public int GetHeight()
	{
		return height;
	}
	
	public FieldState[][] GetFieldStates()
    {
        return fields;
    }
	
	/*public boolean ShipHit(int x, int y)
	{
		return (shipsA.HitTest(x, y) || shipsB.HitTest(x, y));
	}
	
	public boolean ShipHit(Point position)
	{
		return ShipHit(position.x, position.y);
	}
	
	public boolean ShipDamaged(int x, int y)
	{
		return (shipsA.Damaged(x, y) || shipsB.Damaged(x, y));
	}
	
	public boolean ShipDamaged(Point position)
	{
		return (ShipDamaged(position.x, position.y));
	}*/
		
	public enum FieldState
	{
		Water,
		Ship,
		Agressed,
		Damage
	}
}
